﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
	namespace="Buaya.Model" assembly="Buaya.Core">
	
	<class name="Module" table="modules">
		<id name="Id">
			<generator class="native"/>
		</id>
		<property name="Name"/>
		<property name="Order" column="PlacementOrder"/>
		<property name="Inactive"/>
		<bag name="Commands" inverse="true" cascade="all-delete-orphan">
			<key column="ModuleId"/>
			<one-to-many class="ModuleCommand"/>
		</bag>
	</class>

	<class name="ModuleCommand" table="module_commands">
		<id name="Id">
			<generator class="native"/>
		</id>
	    	<many-to-one name="Module" class="Module" column="ModuleId"/>
		<property name="Name"/>
		<property name="Command"/>
	</class>

</hibernate-mapping>
